/*
 * @ : Copyright (c) 2021 Phytium Information Technology, Inc. 
 *  
 * SPDX-License-Identifier: Apache-2.0.
 * 
 * @Date: 2021-07-28 16:19:07
 * @LastEditTime: 2021-08-02 15:04:35
 * @Description:  This files is for 
 * 
 * @Modify History: 
 *  Ver   Who        Date         Changes
 * ----- ------     --------    --------------------------------------
 */
#ifndef EXAMPLE_I2C_EEPROM_H
#define EXAMPLE_I2C_EEPROM_H

#ifdef __cplusplus
extern "C"
{
#endif

#include "ft_types.h"

#define AT24C02_ADDR                 0x50 /* eeprom slave address */
#define AT24C02_CHIP_SEL             0x07 /* eeprom chip select */
#define AT24C02_BLK_SIZE             8    /* eeprom page size, 
                                             one cannot write more bytes to eeprom more than 
                                             this size */

u32 I2cEeMasterInit();
u32 I2cEeMasterWrite(u32 slaveAddr, u8 offset, u8 *pBuf, u32 bufLen);
u32 I2cEeMasterRead(u32 slaveAddr, u8 offset, u8 *pBuf, u32 bufLen);
u32 I2cEeSlaveInit();
u32 I2cEeSlaveReadBuf();
void I2cEeMasterWR();
void I2cEeMaster2Slave();

#ifdef __cplusplus
}
#endif

#endif